Guard RAG collection deletion endpoint#15
Open
tine1117 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the open Algora bounty for
[ISAAC-497] Implement an enhanced RAG Pipeline for Scientific/Research Workflows./claim #45
Bounty reference: https://algora.io/isaac/bounties/clq18zr98000ejs0gt0nv7gwu
Summary
DELETE /api/delete-collectionso the document collection cannot be cleared by a plain GET request.CHROMA_PATH, with the same Docker default used by the document ingestion route, instead of hardcodinglocalhost.Why this matters for the RAG workflow
This is a small document-management safety slice. The existing endpoint can delete the whole uploaded-document collection without an HTTP method guard, and it points at a different Chroma host than the rest of the RAG API. That makes local/Docker behavior inconsistent and makes accidental collection deletion easier than it should be.
I kept this scoped away from the citation/context PRs already open so it should be easy to review independently.
Verification
From
ui/:npx vitest run __tests__/delete-collection.test.ts --reporter verbose npx prettier --check pages/api/delete-collection.ts __tests__/delete-collection.test.ts npx tsc --noEmit --pretty false npm run lint -- --file pages/api/delete-collection.ts --file __tests__/delete-collection.test.ts